﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; 
using CourseArraging.DAO;
using Stone.ServiceInterfaces.ServiceInterfaces;

namespace Stone.ServiceImpl.ServiceImpl
{
    class BasicService : IBasicService
    {
        basicDAO basicdao = new basicDAO();

        #region 分校
        #region 查询分校信息
        public DataContracts.DepEntity getDepEntity(int id)
        {
            return basicdao.getDepEntity(id);
        }

        public string[][] getDepinfo(int dep_id, string dep_name, string dep_address, string dep_phone)
        {
            return basicdao.getDepinfo(dep_id, dep_name, dep_address, dep_phone);
        }

        public System.Data.DataTable getDepinfo4table(int dep_id, string dep_name, string dep_address, string dep_phone)
        {
            return basicdao.getDepinfo4table(dep_id, dep_name, dep_address, dep_phone);
        }

        public bool getEqualDep(string dep_name)
        {
            return basicdao.getEqualDep(dep_name);
        }
        #endregion
        #region 操作分校信息

        public void addDepInfo(DataContracts.DepEntity dep)
        {
            basicdao.addDepInfo(dep);
        }

        public void deleteDepInfo(string Dep_name)
        {
            basicdao.deleteDepInfo(Dep_name);
        }

        public void updateDepinfo(DataContracts.DepEntity dep)
        {
            basicdao.updateDepinfo(dep);
        }

        #endregion
        #endregion 

        #region 权限
        #region 查询权限
        public System.Data.DataTable GetList(string strWhere)
        {
            return basicdao.GetList(strWhere);
        }

        public DataContracts.RightEntity GetModel(int yh_right_id)
        {
            return basicdao.GetModel(yh_right_id);
        }

        public DataContracts.RightEntity RightEntity(int yh_right_id)
        {
            return basicdao.RightEntity(yh_right_id);
        }
        #endregion
        #region 操作权限
        public int Add(DataContracts.RightEntity re)
        {
            return basicdao.Add(re);
        }

        public void Delete(int yh_right_id)
        {
            basicdao.Delete(yh_right_id);
        }

        public void Update(DataContracts.RightEntity re)
        {
            basicdao.Update(re);
        }
        #endregion
        #endregion

        #region 课程
        #region 查询课程

        public string[][] getCourseInfo(int course_id, string course_name)
        {
            return basicdao.getCourseInfo(course_id, course_name);
        }

        public System.Data.DataTable getCourseInfo4table(int course_id, string course_name)
        {
            return basicdao.getCourseInfo4table(course_id, course_name);
        }

        public bool getEqualCourse(string course_name)
        {
            return basicdao.getEqualCourse(course_name);
        }
        #endregion
        #region 操作课程
        public void addCourseInfo(string course_name)
        {
            basicdao.addCourseInfo(course_name);
        }

        public void deleteCourseInfo(string course_name)
        {
            basicdao.deleteCourseInfo(course_name);
        }

        public void updateCourseinfo(int id, string content)
        {
            basicdao.updateCourseinfo(id, content);
        }
        #endregion 
        #endregion

        #region 年级
        #region 查询

        public bool getEqualGrade(string Grade_name)
        {
            return basicdao.getEqualGrade(Grade_name);
        }

        public string[][] getGradeInfo(int grade_id, string grade_name)
        {
            return basicdao.getGradeInfo(grade_id, grade_name);
        }

        public System.Data.DataTable getGradeInfo4table(int grade_id, string grade_name)
        {
            return basicdao.getGradeInfo4table(grade_id, grade_name);
        }
        #endregion
        #region 操作
        public void addGradeInfo(string Grade_name)
        {
            basicdao.addGradeInfo(Grade_name);
        }

        public void deleteGradeInfo(string Grade_name)
        {
            basicdao.deleteGradeInfo(Grade_name);
        }

        public void updateGradeInfo(int id, string content)
        {
            basicdao.updateGradeInfo(id, content);
        }
        #endregion
        #endregion

    }
}
